import api from "@/api";
import axios from "@/utils/axios";


export default {
    payMoney,//支付
    cancelCareDoctor,//取消关注医生的操作
    myCareDoctorList,//我关注的医生的列表
    myCareDoctor,//关注医生操作
    myDoctorAll,//我的医生（全部）
    UpdateMyInfor,
    ShowIllnessLog,
    updatePassword
}

function payMoney(phone, money, day) {
    return axios({
        url: api.myApi.payMoney,
        method: 'post',
        params: {
            phone, money, day
        }
    })
}

function cancelCareDoctor(id, phone) {
    return axios({
        url: api.myApi.cancelCareDoctor,
        method: 'post',
        params: {
            id, phone
        }
    })
}

function myCareDoctorList(phone) {
    return axios({
        url: api.myApi.myCareDoctorList,
        method: 'post',
        params: {phone}
    })
}

function myCareDoctor(id, phone) {
    return axios({
        url: api.myApi.myCareDoctor,
        method: 'post',
        params: {
            id, phone
        }
    })
}

function myDoctorAll() {
    return axios({
        url: api.myApi.myDoctorAll,
        method: 'post'
    })
}

//修改密码
function updatePassword(map) {
    return axios({
        url: api.myApi.updatePassword,
        method: 'post',
        data: map
    })
}

// 修改个人信息
function UpdateMyInfor(name, img) {
    return axios({
            url: api.myApi.UpdateMyInfor,
            method: "post",
            data: {name, img}
        }
    )
}

//病情日志显示
function ShowIllnessLog() {
    return axios({
        url: api.myApi.ShowIllnessLog,
        method: "post",
        data: {}
    })
}
